/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.cx1.model.utils;

import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.cx1.model.StatusType;

/**
 *
 * @author ECH
 */
public class KStatusTypes {
    
    public static StatusType FOR_SALE = new StatusType(KStatusTypeIDs.FOR_SALE, "For Sale", null, null);
    public static StatusType FOR_RENT = new StatusType(KStatusTypeIDs.FOR_RENT, "For Rent", null, null);
    public static StatusType FORECLOSED = new StatusType(KStatusTypeIDs.FORECLOSED, "Foreclosed", null, null);
        
    //CX: TODO: temporary service
    public static StatusType getStatusType(String id) {
        StatusType propertyType = null;
        if (StringUtils.equals(id, KStatusTypeIDs.FOR_SALE)) {
            propertyType = FOR_SALE;
        }
        else if (StringUtils.equals(id, KStatusTypeIDs.FOR_RENT)) {
            propertyType = FOR_RENT;
        }
        else if (StringUtils.equals(id, KStatusTypeIDs.FORECLOSED)) {
            propertyType = FORECLOSED;
        }
        return propertyType;
    }
    
    public static List<StatusType> getAll() {
        List<StatusType> statusTypes = new ArrayList<StatusType>();
        statusTypes.add(FOR_SALE);
        statusTypes.add(FOR_RENT);
        statusTypes.add(FORECLOSED);
        return statusTypes;
    }
}
